<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta http-equiv="X-UA-Compatible" content="IE=edge" />
		<meta
			name="viewport"
			content="width=device-width, initial-scale=1.0,maximum-scale=1.0,user-scalable=no"
		/>

		<title>我的评估</title>
		<!-- 引入样式文件 -->
		<link rel="stylesheet" href="../../common/css/vant-index.css" />
		<link rel="stylesheet" href="../css/monitor.css" />
		<link rel="stylesheet" href="../css/evalution.css" />

		<!-- 引入 Vue 和 Vant 的 JS 文件 -->
		<script src="../../common/js/vue.min.js"></script>
		<script src="../../common/js/vant.min.js"></script>
		<script src="../../common/js/axios.min.js"></script>
		<script src="../../common/js/vue.global.prod.js"></script>
	</head>

	<body>
		<div id="app" v-cloak style="padding-bottom: 65px;">
			<div class="diet_body">
				<a :href="'./behavior/sdscaInfo.html?from=weapp&pid='+patientId">
					<van-list v-if="list.sdscaInfo">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/sdsca1.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">自我管理行为</div>
								<div class="evalution_time">评估时间:{{list.sdscaTime}}</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<a>
					<van-list v-if="list.cdmsesInfo">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/c-dmses1.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">自我管理效能</div>
								<div class="evalution_time">
									评估时间:{{list.personalityTime}}
								</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<a>
					<van-list v-if="list.dcpInfo">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/dcp1.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">密西根糖尿病管理评定量表</div>
								<div class="evalution_time">评估时间:{{list.dcpTime}}</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<a>
					<van-list v-if="list.adknowlInfo">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/adknowl1.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">患者知识量表</div>
								<div class="evalution_time">评估时间:{{list.adknowlTime}}</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<a :href="'./behavior/mmas8Info.html?from=weapp&pid='+patientId">
					<van-list v-if="list.mmas8Info">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/mmas1-8.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">Morisky用药依从性问卷</div>
								<div class="evalution_time">评估时间:{{list.mmas8Time}}</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<a :href="'./behavior/bmqInfo.html?from=weapp&pid='+patientId">
					<van-list v-if="list.bmqInfo">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/bmq1.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">服药信念量表</div>
								<div class="evalution_time">评估时间:{{list.bmqTime}}</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<a>
					<van-list v-if="list.nephropathyInfo">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/complication1.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">并发症风险评估</div>
								<div class="evalution_time">
									评估时间:{{list.nephropathyTime}}
								</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<a :href="'./disease/diabetesInfo.html?from=weapp&pid='+patientId">
					<van-list v-if="list.diabetesInfo">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/diabetes1.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">糖尿病风险评估</div>
								<div class="evalution_time">评估时间:{{list.diabetesTime}}</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<a :href="'./disease/cardiovascularInfo.html?from=weapp&pid='+patientId">
					<van-list v-if="list.angiocardiopathyInfo">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/cardiovascular1.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">心血管十年风险评估</div>
								<div class="evalution_time">
									评估时间:{{list.angiocardiopathyTime}}
								</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<a :href="'./psychology/sasInfo.html?from=weapp&pid='+patientId">
					<van-list v-if="list.sasInfo">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/sas1.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">焦虑自评</div>
								<div class="evalution_time">评估时间:{{list.sasTime}}</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<a :href="'./psychology/sdsInfo.html?from=weapp&pid='+patientId">
					<van-list v-if="list.sdsInfo">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/sds1.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">抑郁自评</div>
								<div class="evalution_time">评估时间:{{list.sdsTime}}</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<a>
					<van-list v-if="list.personalityInfo">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/16pf1.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">卡特尔十六种人格因素测验</div>
								<div class="evalution_time">
									评估时间:{{list.personalityTime}}
								</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<a :href="'./psychology/burnoutInfo.html?from=weapp&pid='+patientId">
					<van-list v-if="list.jobInfo">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/burnout1.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">马氏工作倦怠通用量表</div>
								<div class="evalution_time">评估时间:{{list.jobTime}}</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<a>
					<van-list v-if="list.mmpiInfo">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/style1.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">明尼苏达多相个性测查表</div>
								<div class="evalution_time">评估时间:{{list.mmpiTime}}</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<a :href="'./psychology/psqiInfo.html?from=weapp&pid='+patientId">
					<van-list v-if="list.sleepInfo">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/psqi1.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">匹兹堡睡眠质量指数</div>
								<div class="evalution_time">评估时间:{{list.sleepTime}}</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<a>
					<van-list v-if="list.psychologyInfo">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/scl1-90.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">心理健康临床症状自评测验</div>
								<div class="evalution_time">
									评估时间:{{list.psychologyTime}}
								</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<a :href="'./psychology/happinessInfo.html?from=weapp&pid='+patientId">
					<van-list v-if="list.happyInfo">
						<van-cell center class="flex">
							<img
								class="evalution_img"
								src="../img/evalution/happiness1.png"
								alt=""
							/>
							<div class="flex_right">
								<div class="evalution_title">总体幸福感测试</div>
								<div class="evalution_time">评估时间:{{list.happyTime}}</div>
							</div>
						</van-cell>
					</van-list>
				</a>
				<van-list v-if="nothing==2">
					<van-image
						class="img2"
						id="none"
						src="../img/bloodprofile/none.png"
					></van-image>
					<span class="info3">当前没有评估记录哦～</span>
				</van-list>
			</div>
		</div>
	</body>
	<script src="../../base.js"></script>
	<script src="../../common/js/url.min.js"></script>
	<script type="module">
		import {
			getAction,
			postAction,
			getUrl,
		} from '../../common/js/api/vue3-axios-utils.js'

		const app = Vue.createApp({
			data() {
				return {
					url: {
						getResultList: '/evaluation/get/latest',
					},
					nothing: 2,
					list: [],
					loading: false,
					finished: false,
					patientId:''
				}
			},
			methods: {
				async getResultList() {
					let patientId = this.patientId
					let data = {
						// 患者 ID 从本地存储空间的 pid 获得
						patientId: patientId,
					}
					let url = getUrl() + this.url.getResultList
					const res = await getAction(url, data)
					if (res.data.success) {
						this.list = res.data.result
						for (var i in this.list) {
							if (this.list[i] !== null) {
								this.nothing = 1
							}
						}
					}
				},
				onClickLeft() {
					window.location.href = '../evalutionIndex.html'
				},
				onClickRight() {
					window.location.href = '../index.html?userid=' + localStorage.pid
				},
			},

			created() {
				if(url('?from')=='weapp'){
					this.from = 'weapp'
				}
				if(url('?pid')){
					this.patientId = url('?pid')
				}else{
					this.patientId = localStorage.pid;
				}
				this.getResultList()
			},
		})
		app.use(vant)

		app.use(vant.Lazyload)

		app.mount('#app')
	</script>
</html>
